/*
 * Copyright (c) 2021
 * User:mallplus多商户商城
 * File:MallAdminApplication.java
 * Date:2021/01/12 19:29:12
 */

package com.qyine.rlmall;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 应用启动入口
 * https://github.com/shenzhuan/mallplus on 2018/4/26.
 */
@Slf4j
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@MapperScan({"com.qyine.rlmall.mapper", "com.qyine.rlmall.ums.mapper", "com.qyine.rlmall.sms.mapper", "com.qyine.rlmall.cms.mapper", "com.qyine.rlmall.sys.mapper", "com.qyine.rlmall.oms.mapper", "com.qyine.rlmall.pms.mapper"})
@EnableTransactionManagement
public class MallAdminApplication {
    public static void main(String[] args)  throws UnknownHostException {
        System.out.println("start-------------");
        // SpringApplication.run(MallPortalApplication.class, args);
        ConfigurableApplicationContext application = SpringApplication.run(MallAdminApplication.class, args);
        Environment env = application.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");

        log.info("\n----------------------------------------------------------\n\t" +
                "Application mallplus-Boot is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port  + "/\n\t" +
                "External: \thttp://" + ip + ":" + port  + "/\n\t" +
                "swagger-ui: \thttp://" + ip + ":" + port  + "/swagger-ui.html\n\t" +
                "https://gitee.com/zscat/mallplus/wikis/pages/preview?sort_id=2168368&doc_id=326093"+
                "-----------------页面请部署 mallplus-admin-web-----------------------------------------");
    }
}
